#include "StdAfx.h"
#include "CHGlobal.h"
#include "CHFlatHeaderCtrl.h"
#include "CHListCtrl.h"
#include "CHListView.h"
#include "CHMemDC.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CHListView
/////////////////////////////////////////////////////////////////////////////
CHListView::CHListView()
{
	ImplAttach(&GetListCtrl());
}

CHListView::~CHListView()
{

}

IMPLEMENT_DYNCREATE(CHListView, CListView)

BEGIN_MESSAGE_MAP(CHListView, CListView)
	//{{AFX_MSG_MAP(CHListView)
	ON_WM_CREATE()
	ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomDraw)
	ON_WM_DESTROY()
	ON_WM_ERASEBKGND()
	ON_WM_PAINT()
	ON_WM_SETTINGCHANGE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CHListView::OnDraw( CDC* pDC )
{
	UNUSED_ALWAYS( pDC );
}

#ifdef _DEBUG
void CHListView::AssertValid() const
{
	CListView::AssertValid();
}

void CHListView::Dump(CDumpContext& dc) const
{
	CListView::Dump(dc);
}
#endif //_DEBUG

void CHListView::OnInitialUpdate() 
{
	CListView::OnInitialUpdate();
}

void CHListView::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult) 
{
	OnCustomDrawImpl(pNMHDR, pResult);
}

BOOL CHListView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) 
{
	return OnNotifyImpl(wParam, lParam, pResult);
}

void CHListView::OnDestroy() 
{
	OnDestroyImpl_Pre();
	CListView::OnDestroy();
}

BOOL CHListView::OnEraseBkgnd(CDC* pDC) 
{
	return OnEraseBkgndImpl(pDC);
}

void CHListView::OnPaint() 
{
	OnPaintImpl();
}

int CHListView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CListView::OnCreate(lpCreateStruct) == -1)
		return -1;
	return OnCreateImpl_Post(lpCreateStruct);
}

void CHListView::OnSettingChange(UINT uFlags, LPCTSTR lpszSection) 
{
	CListView::OnSettingChange(uFlags, lpszSection);
	OnSettingChangeImpl_Post(uFlags, lpszSection);
}
